package pl.bristleback.server.bristle.binding.resolvers;

import org.apache.log4j.Logger;

/**
 * //@todo class description
 * <p/>
 * Created on: 2011-04-18 21:42:22 <br/>
 *
 * @author Wojciech Niemiec
 */
public class BooleanPropertyResolver implements PropertyValueResolver<Boolean>{
  private static Logger log = Logger.getLogger(BooleanPropertyResolver.class.getName());

  public Boolean extractValue(Object value) {
    if (value instanceof Boolean) {
      return (Boolean) value;
    } else if (value instanceof String) {
      return Boolean.parseBoolean((String)value);
    } else {
      return null;
    }
  }
}
